package com.bwf.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/6/10 16:04
 * @Copyright 博为峰
 */
@WebServlet(urlPatterns = "/as")
public class AjaxServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String name = req.getParameter("name");
        System.out.println("name = " + name);
        PrintWriter writer = resp.getWriter();
        writer.write("{\n" +
                "  \"code\": 0,\n" +
                "  \"message\": \"string\",\n" +
                "  \"result\": {\n" +
                "    \"date\": \"string\",\n" +
                "    \"dateTime\": \"string\",\n" +
                "    \"time\": \"string\",\n" +
                "    \"weekday\": \"string\"\n" +
                "  }\n" +
                "}");

    }
}
